package com.db.mylogging;

import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;

public class FileAppender implements Appender {

	private final PrintWriter writer;

	public FileAppender(String filename, boolean append) throws IOException {
		writer = new PrintWriter(new FileWriter(filename, append));
	}

	@Override
	public void append(String message) {
		writer.println(message);
		writer.flush();
	}

	@Override
	public void close() {
		writer.close();
	}
}
